#include "CpLog.h"
#include "CpTrack.h"
#include "CpPoint.h"

ClassImp(CpTrack);

//________________________________________________________________________________________________________________
CpTrack::CpTrack(const Int_t& index): TObject(),
fIndex(index),
fNumberOfPoints(0),
fPoints("CpPoint",fNumberOfPoints+1)
{
//
// Constructor
//
}

//________________________________________________________________________________________________________________
CpTrack::~CpTrack()
{
//
// Destructor.
//
}


void CpTrack::Print()
{
  CpInfo(Form("Track %d" ,fIndex));

  CpPoint *point;
  for(Long64_t iPoint=0;iPoint < fNumberOfPoints;iPoint++){
    point = (CpPoint*) fPoints.At(iPoint);
    point->Print();
  }
}


CpPoint* CpTrack::AddPoint(const Double_t& x, const Double_t& y, const Double_t& z, const Double_t& time)
{
  return new (fPoints[fNumberOfPoints++]) CpPoint(x,y,z,time);
}


void CpTrack::SimulatePoints()
{
  CpPoint *point = new (fPoints[fNumberOfPoints++]) CpPoint(0,0,0,0);

  point = new (fPoints[fNumberOfPoints++]) CpPoint(0,0,1,1.0);
  
}


